﻿
//{{{ file documentation -------------------------------------------------------

/*!
 * @file     preferences.cpp
 * @brief    dicodor preferences window class implementation
 */

//}}} --------------------------------------------------------------------------
//{{{ includes / predeclarations -----------------------------------------------

// @(#) $Id: preferences.cpp 53 2012-05-23 13:56:41Z nsouchon-dico@altern.org $

#include "preferences.h"
#include "moc_preferences.cpp"
#include "ui_preferences.h"

//}}} --------------------------------------------------------------------------
//{{{ Preferences --------------------------------------------------------------
//}}} --------------------------------------------------------------------------
//{{{ .Preferences (QWidget * parent) ------------------------------------------

Preferences::Preferences (QWidget * parent) :
    QDialog (parent),
    ui (new Ui::Preferences)
{
    ui->setupUi (this);
    setWindowTitle (tr ("Préférences"));

    initIcons ();
}

//}}} --------------------------------------------------------------------------
//{{{ .~Preferences () ---------------------------------------------------------

Preferences::~Preferences ()
{
    delete ui;
}

//}}} --------------------------------------------------------------------------
//{{{ .void initIcons () -------------------------------------------------------

void Preferences::initIcons ()
{
    ui->clearPersonalDic->setIcon (QIcon::fromTheme ("user-trash"));
    ui->clearTranslateDic->setIcon (QIcon::fromTheme ("user-trash"));
    ui->mergePersonalDic->setIcon (QIcon::fromTheme ("document-open"));
    ui->removeLineFromPersonalDic->setIcon (QIcon::fromTheme ("edit-clear"));
    ui->removeLineFromTranslateDic->setIcon (QIcon::fromTheme ("edit-clear"));
    ui->Ok->setIcon (QIcon::fromTheme ("window-close"));
    setWindowIcon (QIcon::fromTheme ("preferences-desktop"));
}

//}}} --------------------------------------------------------------------------
//{{{ .void changeEvent (QEvent * e) -------------------------------------------

void Preferences::changeEvent (QEvent * e)
{
    QDialog::changeEvent (e);
    switch (e->type ())
    {
    case QEvent::LanguageChange:
        ui->retranslateUi (this);
        break;
    default:
        break;
    }
}

//}}} --------------------------------------------------------------------------
//{{{ .void on_Ok_clicked () ---------------------------------------------------

void Preferences::on_Ok_clicked ()
{
    close ();
}

//}}} --------------------------------------------------------------------------

